package com.state.demo2.impl;

import com.state.demo2.State;
import com.state.demo2.Work;

public class AfternoonState implements State {

	@Override
	public void writeProgram(Work w) {
		if (w.getHour() < 17) {
			System.out.println("当前时间：" + w.getHour() + "，下午状态还行");
		} else {
			// 传入下一个状态
			w.setCurrent(new RestState());
			w.writeProgram();
		}
	}

}
